// Copyright 2022 jeff.li. and/or its affiliates.
/*
 * Acknowledgement:
 * The structure of the expressions is inspired by Halide/TVM IR.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
/*!
 * \file tbir/ir/hlo_builtin.h
 * \brief high level ir builtin intrinsics.
 *
 */
#pragma once

#include <tbir/ir/op_expr.h>

namespace tbir::ir::builtin {

    /*! \brief Collection of builtin intrinsics as ops */
    /******************************************************************************
     * make_kwargs_op
     *****************************************************************************/

    TURBO_EXPORT const Op &make_kwargs_op();

    /******************************************************************************
     * torch ops
     *****************************************************************************/

    TURBO_EXPORT const Op &torch_ops();
    /******************************************************************************
     * numpy ops
     *****************************************************************************/
    TURBO_EXPORT const Op &numpy_ops();

    /******************************************************************************
     * lambda function
     *****************************************************************************/
    TURBO_EXPORT const Op &call_lambda();

    /******************************************************************************
     * builtins functions
     *****************************************************************************/
    TURBO_EXPORT const Op &hlo_if_then_else();

    /******************************************************************************
     * List builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &list___len__();

    TURBO_EXPORT const Op &list___contains__();

    TURBO_EXPORT const Op &list___getitem__();

    TURBO_EXPORT const Op &list___setitem__();

    TURBO_EXPORT const Op &list___getslice__();

    TURBO_EXPORT const Op &list_append();

    TURBO_EXPORT const Op &list_extend();

    TURBO_EXPORT const Op &list_repeat();

    TURBO_EXPORT const Op &list_fused_repeat_one();

    TURBO_EXPORT const Op &list_fused_repeat_many();

    TURBO_EXPORT const Op &list_reserve();

    TURBO_EXPORT const Op &list_index();

    TURBO_EXPORT const Op &list_capacity();

    TURBO_EXPORT const Op &list_pop();

    TURBO_EXPORT const Op &list_insert();

    TURBO_EXPORT const Op &list_remove();

    TURBO_EXPORT const Op &list_clear();

    TURBO_EXPORT const Op &list_reverse();

    TURBO_EXPORT const Op &list_count();

    TURBO_EXPORT const Op &list_sort_no_key();

    TURBO_EXPORT const Op &list_sort();

    TURBO_EXPORT const Op &ft_list___len__();

    TURBO_EXPORT const Op &ft_list___contains__();

    TURBO_EXPORT const Op &ft_list___getitem__();

    TURBO_EXPORT const Op &ft_list___setitem__();

    TURBO_EXPORT const Op &ft_list___getslice__();

    TURBO_EXPORT const Op &ft_list_append();

    TURBO_EXPORT const Op &ft_list_extend();

    TURBO_EXPORT const Op &ft_list_repeat();

    TURBO_EXPORT const Op &ft_list_fused_repeat_one();

    TURBO_EXPORT const Op &ft_list_fused_repeat_many();

    TURBO_EXPORT const Op &ft_list_reserve();

    TURBO_EXPORT const Op &ft_list_index();

    TURBO_EXPORT const Op &ft_list_capacity();

    TURBO_EXPORT const Op &ft_list_pop();

    TURBO_EXPORT const Op &ft_list_insert();

    TURBO_EXPORT const Op &ft_list_remove();

    TURBO_EXPORT const Op &ft_list_clear();

    TURBO_EXPORT const Op &ft_list_reverse();

    TURBO_EXPORT const Op &ft_list_count();

    TURBO_EXPORT const Op &ft_list_sort_no_key();

    TURBO_EXPORT const Op &ft_list_sort();
    /******************************************************************************
     * Dict builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &dict___len__();

    TURBO_EXPORT const Op &dict___contains__();

    TURBO_EXPORT const Op &dict___getitem__();

    TURBO_EXPORT const Op &dict___setitem__();

    TURBO_EXPORT const Op &dict_clear();

    TURBO_EXPORT const Op &dict_reserve();

    TURBO_EXPORT const Op &dict_bucket_count();

    TURBO_EXPORT const Op &dict_keys();

    TURBO_EXPORT const Op &dict_values();

    TURBO_EXPORT const Op &dict_items();

    TURBO_EXPORT const Op &dict_get();

    TURBO_EXPORT const Op &dict_pop();
    /******************************************************************************
     * ADT builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &tuple_len();
    /******************************************************************************
     * Set builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &set___len__();

    TURBO_EXPORT const Op &set___contains__();

    TURBO_EXPORT const Op &set_add();

    TURBO_EXPORT const Op &set_clear();

    TURBO_EXPORT const Op &set_reserve();

    TURBO_EXPORT const Op &set_bucket_count();

    TURBO_EXPORT const Op &set_difference();

    TURBO_EXPORT const Op &set_difference_update();

    TURBO_EXPORT const Op &set_update();

    TURBO_EXPORT const Op &set_union();

    TURBO_EXPORT const Op &set_discard();
    /******************************************************************************
     * String builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &str_lower();

    TURBO_EXPORT const Op &str_upper();

    TURBO_EXPORT const Op &str_append();

    TURBO_EXPORT const Op &str_decode();
    /******************************************************************************
     * Unicode builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &unicode_find();

    TURBO_EXPORT const Op &unicode_encode();

    /******************************************************************************
     * NDArray builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &ndarray___getitem__();

    TURBO_EXPORT const Op &ndarray_getitem_as_int64();

    TURBO_EXPORT const Op &ndarray_getitem_as_double();

    TURBO_EXPORT const Op &ndarray___setitem__();

    TURBO_EXPORT const Op &ndarray_fused_getitem();

    TURBO_EXPORT const Op &ndarray_fused_getitem_as_int64();

    TURBO_EXPORT const Op &ndarray_fused_getitem_as_double();

    TURBO_EXPORT const Op &ndarray_fused_setitem();

    /******************************************************************************
     * Fused functions
     *****************************************************************************/
    TURBO_EXPORT const Op &str_fused_concat();

    TURBO_EXPORT const Op &unicode_fused_concat();

    /******************************************************************************
     * UserData dispatch
     *****************************************************************************/
    TURBO_EXPORT const Op &object___getitem__();

    TURBO_EXPORT const Op &object___setitem__();

    TURBO_EXPORT const Op &object___fused_getitem__();

    TURBO_EXPORT const Op &object___fused_setitem__();

    TURBO_EXPORT const Op &object___dispatch__();

    TURBO_EXPORT const Op &object___getattr__();

    TURBO_EXPORT const Op &object___setattr__();

    TURBO_EXPORT const Op &user_data_get_attr();

    TURBO_EXPORT const Op &user_data_set_attr();

    TURBO_EXPORT const Op &user_data_call();

    TURBO_EXPORT const Op &user_data_call_attr();
    /******************************************************************************
     * Generic Container builtin functions
     *****************************************************************************/
    TURBO_EXPORT const Op &object_append();

    TURBO_EXPORT const Op &object_slice_append();

    TURBO_EXPORT const Op &object_contains();

    TURBO_EXPORT const Op &object_slice_contains();

    TURBO_EXPORT const Op &object_add();

    TURBO_EXPORT const Op &object_extend();

    TURBO_EXPORT const Op &object_slice_add();

    TURBO_EXPORT const Op &object_clear();

    TURBO_EXPORT const Op &object_slice_clear();

    TURBO_EXPORT const Op &object_get_item();

    TURBO_EXPORT const Op &object_slice_get_item();

    TURBO_EXPORT const Op &object_set_item();

    TURBO_EXPORT const Op &object_slice_set_item();

    TURBO_EXPORT const Op &object_slice_load();

    TURBO_EXPORT const Op &object_slice_store();

    TURBO_EXPORT const Op &object_find();

    TURBO_EXPORT const Op &object_slice_lower();

    TURBO_EXPORT const Op &object_slice_upper();

    TURBO_EXPORT const Op &object_slice_isdigit();

    TURBO_EXPORT const Op &object_slice_isalpha();

    TURBO_EXPORT const Op &builtins_print();

    TURBO_EXPORT const Op &object_call();

    TURBO_EXPORT const Op &builtins_unpack();

}  // namespace tbir::ir::builtin
